<%@ Control Language="C#" AutoEventWireup="true" CodeFile="search.ascx.cs" Inherits="fundies_controls_quotes_search" %>
<%@ Register Src="QuoteList.ascx" TagName="QuoteList" TagPrefix="uc1" %>
<%@ Register Src="../comments/Comments.ascx" TagName="Comments" TagPrefix="uc2" %>
<h2>FSTDT Search</h2>

<asp:Panel runat="server" ID="pnlSearchQuotes" Width="100%" DefaultButton="btnSearchQuotes">
    <fieldset>
        <legend>Search Quotes</legend>
        <table width="100%" border="0">
            <tr>
                <td width="50%" align="left" valign="top">
                    <p>
                    Fundie:<br />
                    <asp:TextBox runat="server" ID="txtFundie" MaxLength="100" />
                    </p>
                </td>
                <td width="50%" align="left" valign="top">
                    <p>
                    Board:<br />
                    <asp:TextBox runat="server" ID="txtBoard" MaxLength="100" />
                    </p>
                </td>
            </tr>
            <tr>
                <td width="50%" align="left" valign="top">
                    <p>
                    Quote:<br />
                    <asp:TextBox runat="server" ID="txtQuote" MaxLength="100" />
                    </p>                
                </td>
                <td width="50%" align="left" valign="bottom">
                    <p>
                    <asp:Button runat="server" ID="btnSearchQuotes" Text="Search" OnClick="btnSearchQuotes_Click" />
                    </p>
                </td>
            </tr>
            
        </table>
    </fieldset>
</asp:Panel>

<div>&nbsp;</div>

<asp:Panel runat="server" ID="pnlComments" Width="100%" DefaultButton="btnSearchComments">
    <fieldset>
        <legend>Search Comments</legend>
        <p>
            Author:<br />
            <asp:TextBox runat="server" ID="txtAuthor" MaxLength="100" />
        </p>
        <p>
            Comment:<br />
            <asp:TextBox runat="server" ID="txtComment" MaxLength="100" />
        </p>
        <p>
            <asp:Button runat="server" ID="btnSearchComments" Text="Search" OnClick="btnSearchComments_Click" />
        </p>
    </fieldset>
</asp:Panel>
<blockquote>
    <span style="font-size : 9pt;">
    <b>Search Help:</b><br />
    <tt>hello world</tt> finds all quotes containing the exact phrase "hello world".<br />
    <tt>hell*</tt> finds quotes containing "hell", "hello", "hellz", etc.<br />
    <tt>hello and world</tt> finds quotes containing the word "hello" and the word "world".<br />
    <tt>hello or world</tt> finds quotes containing the word "hello" or the word "world".
    </span>
</blockquote>

<div>&nbsp;</div>

<asp:Panel runat="server" ID="pnlResults" Visible="false" Width="100%">
    <hr />
    <h3>Search Results</h3>
    <asp:Repeater runat="server" ID="rptPages">
        <ItemTemplate>
            <asp:LinkButton runat="server" ID="btnPage"
                CommandArgument='<%# Eval("ItemText") %>'
                OnCommand="NewPage"
                Text='<%# Eval("ItemText") %>'
                Enabled='<%# !Convert.ToBoolean(Eval("IsCurrentPage")) %>'/>
        </ItemTemplate>
    </asp:Repeater>
    
    <asp:MultiView runat="server" ID="mviewResults">
        <asp:View runat="server" ID="viewQuotes">
            <uc1:QuoteList ID="QuoteList1" runat="server" EnableViewState="false" />
        </asp:View>
        <asp:View runat="server" ID="viewComments">
            <uc2:Comments ID="Comments1" runat="server"
                ShowQuoteLink="true" EnableViewState="false"/>
        </asp:View>
        <asp:View runat="server" ID="viewError">
            <p>
                No results found matching criteria.
            </p>
        </asp:View>
    </asp:MultiView></asp:Panel>